import { useCounterStore } from '@/store/counter.js'
import { getUserList } from '@/api/api.js'

export const useHomeView = () => {
  // 定义变量
  const counter = useCounterStore()
  /**
   * 点击使用pinia实例
   */
  const increment = () => {
    counter.increment()
  }
  /**
   * 点击调用接口
   */
  const getHttp = () => {
    getUserList({ name: 'cxx' }).then(res => {
      const { list } = res
    })
  }

  return {
    counter,
    increment,
    getHttp,
  }
}
